home *** CD-ROM | disk | FTP | other *** search
- function setActiveItem(mc)
- {
- activeSection = mc;
- sectionTitle = mc.secName;
- }
- function unClickActiveItems()
- {
- if(activeSection)
- {
- i = 0;
- while(i < activeSection.pItems.length)
- {
- activeSection.pItems[i].gotoAndStop(1);
- i++;
- }
- }
- }
- function closeLargeImageViewer()
- {
- setMenuVisible(true);
- largeImageLoader._visible = false;
- }
- function showNextLargeImage()
- {
- largeImageLoader.nextImage();
- }
- function showPreviousLargeImage()
- {
- largeImageLoader.previousImage();
- }
- function itemObject(pName, pPath)
- {
- iObj = new Object();
- iObj.pName = pName.slice(0,-1);
- iObj.pPath = pPath.slice(0,-2);
- return iObj;
- }
- function sectionObject(pName, pPath)
- {
- sObj = new Object();
- sObj.pName = pName.slice(0,-1);
- sObj.pPath = pPath.indexOf("\n") == -1 ? pPath : pPath.slice(0,-2);
- sObj.pItems = new Array();
- return sObj;
- }
- function makeMenus(lst)
- {
- tmp = lst.split("---");
- tmp.shift();
- ln = 0;
- while(ln < tmp.length)
- {
- it = tmp[ln].split("-");
- section = it[0].split("@");
- menuObject.push(sectionObject(section[0],section[1]));
- currentObj = menuObject[ln];
- sub = 1;
- while(sub < it.length)
- {
- item = it[sub].split("@");
- obj = itemObject(item[0],item[1]);
- currentObj.pItems.push(obj);
- sub++;
- }
- ln++;
- }
- xPos = 323;
- itemCount = 0;
- sec = 0;
- while(sec < menuObject.length)
- {
- ixPos = 350;
- iyPos = 210;
- pSec = menuObject[sec];
- duplicateMovieClip(secObj,"secObj" + sec,16384 + this.getNextHighestDepth());
- mc = _root["secObj" + sec];
- menuMcs.push(mc);
- mc.secName = pSec.pName;
- mc.secPath = pSec.pPath;
- mc.pItems = new Array();
- itemsArray = new Array();
- i = 0;
- while(i < pSec.pItems.length)
- {
- trace(pSec.pItems[i].pName);
- duplicateMovieClip(itemObj,"itemObj" + itemCount,16384 + this.getNextHighestDepth());
- imc = _root["itemObj" + itemCount];
- imc.iName = pSec.pItems[i].pName;
- imc.pPath = pSec.pItems[i].pPath;
- imc.secPath = pSec.pPath;
- imc._x = ixPos;
- imc._y = iyPos;
- imc._visible = false;
- mc.pItems.push(imc);
- if(i == 2 || i == 5 || i == 8 || i == 11 || i == 14)
- {
- ixPos = 350;
- iyPos += 12;
- }
- else
- {
- ixPos += 170;
- }
- itemCount += 1;
- i++;
- }
- mc._x = xPos;
- mc._y = 180;
- xPos += 170;
- sec++;
- }
- }
- function loadPictures(path, imgList)
- {
- imgs = Array();
- i = 0;
- while(i < imgList.length)
- {
- imgs.push(path + _global.delim + imgList[i]);
- i++;
- }
- imgLoader.setImageList(imgs);
- if(imgs[0].indexOf("shot") == -1)
- {
- imgLoader.imageZoomButton._visible = true;
- }
- else
- {
- imgLoader.imageZoomButton._visible = false;
- }
- videoWindow._visible = false;
- imgLoader._visible = true;
- }
- function setPictureNumber(num)
- {
- imgLoader.setImageButtonClicked(num);
- imgLoader.loadImage(num);
- }
- function showLargeImageViewer()
- {
- setMenuVisible(false);
- largeImageLoader.setImageList(imgLoader.getImageList());
- largeImageLoader.loadLargeImage(imgLoader.getSelectedImageNumber());
- largeImageLoader._visible = true;
- }
- function loadVideo(resources, num)
- {
- videoWindow._visible = true;
- vPath = resolveVideoURL(currentVideoPath + _global.delim + resources[num]);
- trace("LOADING VIDEO: " + vPath);
- videoWindow.setContentPath(vPath);
- imgLoader._visible = false;
- }
- function setVideoPath(path)
- {
- currentVideoPath = path;
- }
- function setVideoResourcesList(lst)
- {
- trace(lst);
- videoResourceList = lst;
- pNum = lst.length;
- videoWindow.setVideoLabels(pNum);
- }
- function setMenuVisible(bool)
- {
- if(bool)
- {
- mc = 0;
- while(mc < menuMcs.length)
- {
- menuMcs[mc]._visible = true;
- mc++;
- }
- m = 0;
- while(m < activeSection.pItems.length)
- {
- activeSection.pItems[m]._visible = true;
- m++;
- }
- }
- else
- {
- mc = 0;
- while(mc < menuMcs.length)
- {
- menuMcs[mc]._visible = false;
- imc = 0;
- while(imc < menuMcs[mc].pItems.length)
- {
- menuMcs[mc].pItems[imc]._visible = false;
- imc++;
- }
- mc++;
- }
- }
- }
- function setInfoText(txt)
- {
- if(txt != undefined)
- {
- mainTextBox.htmlText = txt;
- }
- }
- function loadInfoText(path)
- {
- infoLoader.load(path + _global.delim + "info.txt");
- }
- function setMainTitle(txt)
- {
- infoTitle = txt;
- }
- function unClickMenus()
- {
- infoTitle = "";
- infoText = "";
- sec = 0;
- while(sec < menuObject.length)
- {
- _root["secObj" + sec].gotoAndStop(1);
- _root["secObj" + sec].hideItems();
- sec++;
- }
- }
- function stopVideo()
- {
- if(flvPlaying)
- {
- this.videoWindow.myVideoPlayer.pause();
- }
- }
- function getFixedPath(path)
- {
- if(_level0._url == "" || _level0._url == undefined)
- {
- fixedPath = path;
- }
- else
- {
- fixedPath = _level0._url + _global.delim + path;
- }
- return fixedPath;
- }
- function setOpenFolder(path, platformNumber)
- {
- trace("Setting Open Folder " + path + " " + platformNumber);
- pathTest = path;
- plat = System.capabilities.os;
- if(plat.toLowerCase().indexOf("win") != -1)
- {
- xPath = path;
- openFolderButton.setPath(xPath);
- openFolderButton._visible = true;
- rootOpenFolderPath = xPath;
- }
- else
- {
- openFolderButton._visible = false;
- openFolderMacPathIndicator.pathText = path;
- openFolderMacPathIndicator._visible = true;
- }
- imgLoader._visible = true;
- videoWindow._visible = false;
- }
- function zoomVideoPlayer()
- {
- flvPlaying = false;
- if(videoZoomed)
- {
- setMenuVisible(true);
- videoWindow.gotoAndStop(1);
- setVideoItem(0);
- videoWindow.myVideoPlayer.play();
- }
- else
- {
- trace("Big Video Player");
- setMenuVisible(false);
- cPath = videoWindow.myVideoPlayer.contentPath;
- videoWindow.gotoAndStop(2);
- trace(videoWindow.bigVideoPlayer._x);
- setVideoItem(0);
- trace(videoWindow.bigVideoPlayer.contentPath);
- videoWindow.bigVideoPlayer.play();
- }
- videoZoomed = !videoZoomed;
- }
- function toggleVideoSelector()
- {
- if(selectorVisible)
- {
- videoWindow.videoSelector._visible = false;
- selectorVisible = false;
- }
- else
- {
- videoWindow.videoSelector._visible = true;
- selectorVisible = true;
- }
- }
- function setVideoItem(num)
- {
- trace("SET VIDEO ITEM");
- loadVideo(videoResourceList,num);
- trace("VIDEO ITEM TO BE LOADED=" + videoResourceList[num]);
- videoWindow.videoSelector._visible = false;
- selectorVisible = false;
- }
- function resolveVideoURL(url)
- {
- var _loc11_ = System.capabilities.os;
- if(_loc11_ != "MacOS")
- {
- return url;
- }
- var _loc5_ = _level0._url;
- var _loc9_ = _loc5_.substr(0,4);
- if(_loc9_ == "http")
- {
- return url;
- }
- var _loc10_ = _loc5_.indexOf("/Volumes/");
- if(_loc10_ == -1)
- {
- return url;
- }
- var _loc7_ = String("file:///Volumes/").length;
- var _loc12_ = _loc5_.substring(_loc7_);
- var _loc3_ = _loc12_.split("/");
- _loc3_.splice(_loc3_.length - 1,1);
- var _loc4_ = url.split("/");
- var _loc1_ = 0;
- while(_loc1_ < _loc4_.length)
- {
- var _loc2_ = _loc4_[_loc1_];
- if(_loc2_ == "..")
- {
- _loc3_.splice(_loc3_.length - 1,1);
- }
- else
- {
- _loc3_.push(_loc2_);
- }
- _loc1_ = _loc1_ + 1;
- }
- var _loc8_ = _loc3_.join(":");
- return _loc8_;
- }
- var os = System.capabilities.os;
- trace(ostype);
- _global.delim = "";
- if(ostype.indexOf("Mac") == -1)
- {
- _global.delim = "\\";
- }
- else
- {
- _global.delim = "/";
- }
- var videoZoomed = false;
- var vidPath = "";
- var currentVideoPath = "";
- var videoResourceList = new Array();
- var menuMcs = new Array();
- var videoInitialised = false;
- var activeSection;
- var rootOpenFolderPath;
- myAppPath = mdm.Application.path;
- if(myAppPath == undefined)
- {
- myAppPath = "";
- }
- var menuObject = new Array();
- menusPath = mdm.Application.path + "menus" + _global.delim + "menu_items.txt";
- var st = "dsfd!";
- var activeSection = 0;
- var flvPlaying = false;
- videoWindow._visible = false;
- appPath = menusPath;
- var lv = new LoadVars();
- lv.onData = function(dat)
- {
- appPath = dat;
- makeMenus(dat);
- trace(menuObject);
- };
- lv.load(menusPath);
- var infoLoader = new LoadVars();
- infoLoader.onData = function(txt)
- {
- setInfoText(txt);
- };
- var selectorVisible = false;
-